//---------------------------------------------------------------------------

#ifndef TArresterMapH
#define TArresterMapH

#include <ExtCtrls.hpp>
//#include <QGraphics.hpp>
#include <vector.h>

#include "TArrester.h"
#include "TTrack.h"
#include "TSpeedTimePosition.h"
#include "TCut.h"

//---------------------------------------------------------------------------

class TCutsImages
{
public:
   float Position;
   TImage *Image;

   __fastcall TCutsImages();
   bool __fastcall Initialize(void);
private:
};

class TArresterMap
{
public:
   float MaxV;
   float StopPoint;
   unsigned short TrackNumber;

   float Length;
   float FrontLength;
   float BackLength;
   TImage *Map;
   vector<TCutsImages> CutsImages;

   __fastcall TArresterMap();
   bool __fastcall Initialize(TImage * ShowArresterMap, TArresters *ShowArresters, TTracks *ShowTracks);
   void __fastcall DrawInitMap(const unsigned short TrackNumber);
   void __fastcall DrawCutMap(const float Speed, const float Position, const float PreSpeed, const float PrePosition);
   void __fastcall MoveCuts(const unsigned short CutIndex, const float Position);
   void __fastcall DrawResultMap(const unsigned short TrackNumber, TCuts *Cuts, TVTS *VTS);
   void __fastcall DrawStopDistance(const float MaxPos);
private:
   float XScale;
   float VScale;
   float BX;
   float EX;
   float PreSpeed;
   float PrePosition;

   unsigned short VB;

   unsigned short ProfileHeight;

   TArresters * Arresters;
   TTracks *Tracks;
   TProfile *Profile;

   Graphics::TBitmap * Image;

   void __fastcall DrawStopPoint(void);
   void __fastcall DrawProfile(void);
   unsigned short __fastcall CX(const float Position);
   unsigned short __fastcall CV(const float Speed);
   void __fastcall DrawArrestersPositions(void);
   void __fastcall DrawSpeedGradution(void);
};




#endif
